<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">

var xhr;
var requestType = "";

function createXMLHttpRequest()
{
    if (window.ActiveXObject) 
    {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest)   
    {
        xhr = new XMLHttpRequest();
    }
}

 function startRequest(requestedList)
{ 
	createXMLHttpRequest();
    if (xhr)
    {
        requestType = requestedList;
        xhr.onreadystatechange = handleStateChange;
        var url = "/peony/abc.do?id=" + requestedList + "&timestamp=" + new Date().getTime();
        url = encodeURI(encodeURI(url));
        xhr.open("GET",url,true);
        xhr.send(null);
    }
    else
        alert("XMLHTTPREQUEST IS FALSE");
}

 function startRequest1()
{ 
	createXMLHttpRequest();
    if (xhr)
    {
        xhr.onreadystatechange = handleStateChange1;
        var url = "/peony/abcde.do"+"?timestamp=" + new Date().getTime();;
        xhr.open("GET",url,true);
        xhr.send(null);
    }
    else
        alert("XMLHTTPREQUEST IS FALSE");
}
 
 function handleStateChange()
{
    if (xhr.readyState == 4)
    {
        if (xhr.status == 200)
        {
            var xmlDoc  = xhr.responseXML;
            var results = xmlDoc.getElementsByTagName("RESULT");
            var processState = results[0].getElementsByTagName("PROCESSSTATE")[0].childNodes[0].nodeValue;
            alert(processState);
        }
    }
}

 function handleStateChange1()
{
    if (xhr.readyState == 4)
    {
        if (xhr.status == 200)
        {
            var xmlDoc  = xhr.responseText;
            document.getElementById("time").setAttribute("value",xmlDoc);
        }
    }
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>This Is A Test</title>
</head>
<body>
<input type="text" onBlur="startRequest('中国')">
<input type="text" id="time" onBlur="startRequest1()">
</body>
</html>